package com.zte.cl.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.zte.cl.model.CompanyBaseInfo;

@Repository
public interface CompanyBaseInfoRepository extends JpaRepository<CompanyBaseInfo, Integer> {

	List<CompanyBaseInfo> findByChannelId(int channelId);
	
	List<CompanyBaseInfo> findByChannelIdIn(List<Integer> channelIdList);
	
	List<CompanyBaseInfo> findByCompanyidIn(List<String> companyIdList);
	
	CompanyBaseInfo findByCompanyid(String companyId);
	
	@Query("select c.companyid from CompanyBaseInfo c where c.channelId in (?1)")
	String[] findCompanyIdByChannelIdIn(Integer[] channelIds);
}
